learn your lesson
to learn what to do or not to do in the future because you have had a bad experience in the past